/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sideral;

import java.awt.Graphics;
import java.awt.Image;
import javax.swing.JDesktopPane;

/**
 *
 * @author Deyves
 */
public class BackgroundedDesktopPane extends JDesktopPane{
    Image img;  
  
 public BackgroundedDesktopPane() {  
  try {  
   java.net.URL caminho = Principal.class.getResource("C:\\Users\\Deyves\\Dropbox\\ProjetoSideral\\Projeto sideral\\Projeto sideral\\Sideral.JPEG");  
   img = javax.imageio.ImageIO.read(caminho);  
  } catch (Exception e) {}  
 }  
  
 public void paintComponent(Graphics g) {  
  super.paintComponent(g);  
  if (img != null)  
   g.drawImage(img, 0, 0, this.getWidth(), this.getHeight(), this);  
  else  
   g.drawString("Imagem não encontrada", 50, 50);  
 }  
}
